#ifndef PROPERTYTEST_H
#define PROPERTYTEST_H

#include <QColor>
#include <QString>
#include <QObject>

class propertytest : public QObject
{
    Q_OBJECT

    Q_PROPERTY(QColor color /*READ getColor WRITE setColor*/ MEMBER m_color NOTIFY colorChanged)
    Q_PROPERTY(qreal spacing MEMBER m_spacing NOTIFY spacingChanged)
    Q_PROPERTY(QString text MEMBER m_text NOTIFY textChanged)

public:
    propertytest();


    QColor getColor() const { return m_color; }
    void setColor(const QColor& c) { m_color = c; }

    qreal getSpacing() const { return m_spacing; }
    void setSpacing(qreal s){ m_spacing = s; }

    QString getText() const { return m_text; }
    void setText(const QString& text){ m_text = text; }


signals:
    void colorChanged();
    void spacingChanged();
    void textChanged(const QString &newText);

public slots:
    void sltColorChanged();
    void sltSpacingChanged();
    void sltTextChanged(const QString &newText);

private:
    QColor  m_color;
    qreal   m_spacing;
    QString m_text;
};

#endif // PROPERTYTEST_H
